package com.espirit.eap.manager;

import org.apache.commons.lang3.StringUtils;

public abstract class LinkModel {
	Class clazz;
	String method;
	String property;
	String i18n;
	public String getI18n() {
		return i18n;
	}

	public void setI18n(String i18n) {
		this.i18n = i18n;
	}

	public LinkModel(Class clazz, String method) {
		super();
		setClazz(clazz);
		setMethod(method);
	}

	public LinkModel(Class clazz, String method, String property) {
		super();
		setClazz(clazz);
		setMethod(method);
		setProperty(property);
	}
	
	public String getProperty() {
		return property;
	}
	public void setProperty(String property) {
		this.property = property;
	}
	public Class getClazz() {
		return clazz;
	}
	public void setClazz(Class clazz) {
		this.clazz = clazz;
	}
	public String getMethod() {
		return method;
	}
	public void setMethod(String method) {
		this.method = method;
	}
	
	public String joinDefaultParameter(){
		return joinParameter(null);
	}
	public String joinParameter(String property){
		if (StringUtils.isEmpty(property)){
			return "&model.id=";
		} else {
			return "&model." + property + ".id=";
		}
	}
	
	public abstract String getParameter();
}
